package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.Blog;
import com.yami.shop.bean.model.Comment;
import com.yami.shop.bean.vo.CommentMannageVo;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentMapper extends BaseMapper<Comment> {

    IPage<CommentMannageVo> getAdminAllCommentList(@Param("page") PageParam<CommentMannageVo> page, @Param("commentMannageVo") CommentMannageVo commentMannageVo);

    List<CommentMannageVo> getAdminAllCommentList(@Param("commentMannageVo") CommentMannageVo commentMannageVo);

    /**
     *  查询热评
     *
     * @param blogId
     * @param limit
     * @return
     */
    List<Comment> getHotComment(@Param("blogId") Long blogId, @Param("userId") String userId, @Param("limit") Integer limit, @Param("hotLimit") Integer hotLimit);

    /**
     *  通过博客id和评论来源查询列表
     *
     * @param blogId
     * @param type
     * @return
     */
    List<Comment> findCommentByBlogId(@Param("blogId") Long blogId, @Param("type") String type);

    /**
     *  查询用户历史个人点赞记录
     *
     * @param page
     * @param currentId
     * @param content
     * @return
     */
    IPage<Blog> pagePraiseUserBrowseHistory(PageParam<Blog> page, @Param("currentId") String currentId, @Param("content") String content);
}
